const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require("webpack");
module.exports = {
    runtimeCompiler: true,
    publicPath: './', // 设置打包文件相对路径, baseUrl 已被官方不建议使用

    devServer: {
        //host: '0.0.0.0',
        port: 8081,
        open: process.platform === 'darwin', //配置自动启动浏览器
        https: false,
        hotOnly: false,
        proxy: { // 跨域请求代理 https://www.cnblogs.com/cckui/p/10331432.html
            '/api': {
                target: 'http://localhost:9380', // 接口地址
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/': ''
                }
            }
        }
    },
    productionSourceMap: false, // 生产环境是否生成 sourceMap 文件
    configureWebpack: {
        plugins: [
            new CopyWebpackPlugin([
                { from: 'node_modules/@liveqing/liveplayer/dist/component/crossdomain.xml' },
                { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer.swf' },
                { from: 'node_modules/@liveqing/liveplayer/dist/component/liveplayer-lib.min.js', to: 'js/' },
            ]),
        ]
    }
    //  configureWebpack: {
    //   performance:{ // webpack打包压缩限制报错这里禁掉这个warning信息
    //     hints: false
    //   }
    // }
}
